package com.tiancan.design.message.controller;

import com.tiancan.design.message.service.SendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/** @author tiancan */
@RestController
public class SendMsgController {
  @Autowired private SendService sendService;

  @PostMapping("/email/{email}/{code}")
  public boolean sendEmail(@PathVariable("email") String email, @PathVariable("code") String code) {
    return sendService.sendMessage(email, "这是登录系统的验证码", code);
  }
}
